<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ESP32 HTTPS Server: httpsserver::HTTPConnection Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP32 HTTPS Server
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classhttpsserver_1_1HTTPConnection.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classhttpsserver_1_1HTTPConnection-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">httpsserver::HTTPConnection Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Represents a single open connection for the plain <a class="el" href="classhttpsserver_1_1HTTPServer.html" title="Main implementation for the plain HTTP server. Use HTTPSServer for TLS support. ">HTTPServer</a>, without TLS.  
 <a href="classhttpsserver_1_1HTTPConnection.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="HTTPConnection_8hpp_source.html">HTTPConnection.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for httpsserver::HTTPConnection:</div>
<div class="dyncontent">
<div class="center"><img src="classhttpsserver_1_1HTTPConnection__inherit__graph.png" border="0" usemap="#httpsserver_1_1HTTPConnection_inherit__map" alt="Inheritance graph"/></div>
<map name="httpsserver_1_1HTTPConnection_inherit__map" id="httpsserver_1_1HTTPConnection_inherit__map">
<area shape="rect" id="node3" href="classhttpsserver_1_1HTTPSConnection.html" title="Connection class for an open TLS&#45;enabled connection to an HTTPSServer. " alt="" coords="6,155,211,181"/>
<area shape="rect" id="node2" href="classhttpsserver_1_1ConnectionContext.html" title="Internal class to handle the state of a connection. " alt="" coords="5,5,212,32"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for httpsserver::HTTPConnection:</div>
<div class="dyncontent">
<div class="center"><img src="classhttpsserver_1_1HTTPConnection__coll__graph.png" border="0" usemap="#httpsserver_1_1HTTPConnection_coll__map" alt="Collaboration graph"/></div>
<map name="httpsserver_1_1HTTPConnection_coll__map" id="httpsserver_1_1HTTPConnection_coll__map">
<area shape="rect" id="node2" href="classhttpsserver_1_1ConnectionContext.html" title="Internal class to handle the state of a connection. " alt="" coords="5,95,212,121"/>
<area shape="rect" id="node3" href="classhttpsserver_1_1WebsocketHandler.html" title="httpsserver::WebsocketHandler" alt="" coords="5,5,212,32"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab7bf3e57776f965a887d3d736a70578b"><td class="memItemLeft" align="right" valign="top"><a id="ab7bf3e57776f965a887d3d736a70578b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>HTTPConnection</b> (<a class="el" href="classhttpsserver_1_1ResourceResolver.html">ResourceResolver</a> *resResolver)</td></tr>
<tr class="separator:ab7bf3e57776f965a887d3d736a70578b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a477f2a00400be60f3b0ca08ab53beda5"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1HTTPConnection.html#a477f2a00400be60f3b0ca08ab53beda5">initialize</a> (int serverSocketID, <a class="el" href="classhttpsserver_1_1HTTPHeaders.html">HTTPHeaders</a> *defaultHeaders)</td></tr>
<tr class="separator:a477f2a00400be60f3b0ca08ab53beda5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a179e017c29682270eb69115df3aab0e7"><td class="memItemLeft" align="right" valign="top"><a id="a179e017c29682270eb69115df3aab0e7"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>closeConnection</b> ()</td></tr>
<tr class="separator:a179e017c29682270eb69115df3aab0e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7edfef457a87401193d39825d909eaca"><td class="memItemLeft" align="right" valign="top"><a id="a7edfef457a87401193d39825d909eaca"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>isSecure</b> ()</td></tr>
<tr class="separator:a7edfef457a87401193d39825d909eaca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e103c4b601199d575de6b6f29d7fb95"><td class="memItemLeft" align="right" valign="top">virtual IPAddress&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1HTTPConnection.html#a5e103c4b601199d575de6b6f29d7fb95">getClientIP</a> ()</td></tr>
<tr class="separator:a5e103c4b601199d575de6b6f29d7fb95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6331ad5e18ac367c0ac6477bebc25dd8"><td class="memItemLeft" align="right" valign="top"><a id="a6331ad5e18ac367c0ac6477bebc25dd8"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>loop</b> ()</td></tr>
<tr class="separator:a6331ad5e18ac367c0ac6477bebc25dd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af00c9a10be467a64ece8f820e939190d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1HTTPConnection.html#af00c9a10be467a64ece8f820e939190d">isClosed</a> ()</td></tr>
<tr class="separator:af00c9a10be467a64ece8f820e939190d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d8889292d644962a859e6e9b0bff305"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1HTTPConnection.html#a6d8889292d644962a859e6e9b0bff305">isError</a> ()</td></tr>
<tr class="separator:a6d8889292d644962a859e6e9b0bff305"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr class="memitem:aee781f64b7522823dccc5cb5ccf5cbe6"><td class="memItemLeft" align="right" valign="top"><a id="aee781f64b7522823dccc5cb5ccf5cbe6"></a>enum &#160;</td><td class="memItemRight" valign="bottom">{ <br />
&#160;&#160;<b>STATE_UNDEFINED</b>, 
<b>STATE_INITIAL</b>, 
<b>STATE_REQUEST_FINISHED</b>, 
<b>STATE_HEADERS_FINISHED</b>, 
<br />
&#160;&#160;<b>STATE_BODY_FINISHED</b>, 
<b>STATE_WEBSOCKET</b>, 
<b>STATE_CLOSING</b>, 
<b>STATE_CLOSED</b>, 
<br />
&#160;&#160;<b>STATE_ERROR</b>
<br />
 }</td></tr>
<tr class="separator:aee781f64b7522823dccc5cb5ccf5cbe6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3e282bc82a013a5de476ebbe02e326b"><td class="memItemLeft" align="right" valign="top"><a id="ac3e282bc82a013a5de476ebbe02e326b"></a>enum &#160;</td><td class="memItemRight" valign="bottom">{ <b>CSTATE_UNDEFINED</b>, 
<b>CSTATE_ACTIVE</b>, 
<b>CSTATE_CLOSED</b>
 }</td></tr>
<tr class="separator:ac3e282bc82a013a5de476ebbe02e326b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a6e17e136d309d99ec0fd45714f9db083"><td class="memItemLeft" align="right" valign="top"><a id="a6e17e136d309d99ec0fd45714f9db083"></a>
virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><b>writeBuffer</b> (byte *buffer, size_t length)</td></tr>
<tr class="separator:a6e17e136d309d99ec0fd45714f9db083"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ef67171d84d4149f1bcf1c591504233"><td class="memItemLeft" align="right" valign="top"><a id="a8ef67171d84d4149f1bcf1c591504233"></a>
virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><b>readBytesToBuffer</b> (byte *buffer, size_t length)</td></tr>
<tr class="separator:a8ef67171d84d4149f1bcf1c591504233"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ef8666437d49c4447cb564c60f43044"><td class="memItemLeft" align="right" valign="top"><a id="a9ef8666437d49c4447cb564c60f43044"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>canReadData</b> ()</td></tr>
<tr class="separator:a9ef8666437d49c4447cb564c60f43044"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acec3423f118019b6b6529f2d0d600f31"><td class="memItemLeft" align="right" valign="top"><a id="acec3423f118019b6b6529f2d0d600f31"></a>
virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><b>pendingByteCount</b> ()</td></tr>
<tr class="separator:acec3423f118019b6b6529f2d0d600f31"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:adc4a4fedc7127a43a44f943d01435cfb"><td class="memItemLeft" align="right" valign="top"><a id="adc4a4fedc7127a43a44f943d01435cfb"></a>
unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>_lastTransmissionTS</b></td></tr>
<tr class="separator:adc4a4fedc7127a43a44f943d01435cfb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed7eef3aef4022cef6ee03de0eeff205"><td class="memItemLeft" align="right" valign="top"><a id="aed7eef3aef4022cef6ee03de0eeff205"></a>
unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>_shutdownTS</b></td></tr>
<tr class="separator:aed7eef3aef4022cef6ee03de0eeff205"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0023db5e5feeaf2841b74086114e9469"><td class="memItemLeft" align="right" valign="top"><a id="a0023db5e5feeaf2841b74086114e9469"></a>
enum httpsserver::HTTPConnection:: { ... } &#160;</td><td class="memItemRight" valign="bottom"><b>_connectionState</b></td></tr>
<tr class="separator:a0023db5e5feeaf2841b74086114e9469"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc507f44213441dec1aec67d4d3314cf"><td class="memItemLeft" align="right" valign="top"><a id="afc507f44213441dec1aec67d4d3314cf"></a>
enum httpsserver::HTTPConnection:: { ... } &#160;</td><td class="memItemRight" valign="bottom"><b>_clientState</b></td></tr>
<tr class="separator:afc507f44213441dec1aec67d4d3314cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a9fd43ee1d0a0ddfe175fbe42ecca0be9"><td class="memItemLeft" align="right" valign="top"><a id="a9fd43ee1d0a0ddfe175fbe42ecca0be9"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>HTTPRequest</b></td></tr>
<tr class="separator:a9fd43ee1d0a0ddfe175fbe42ecca0be9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8cb19d24f15bc4b03a83ae832b64a57"><td class="memItemLeft" align="right" valign="top"><a id="ae8cb19d24f15bc4b03a83ae832b64a57"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>HTTPResponse</b></td></tr>
<tr class="separator:ae8cb19d24f15bc4b03a83ae832b64a57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61b01a21cbcb7abdf4d05cca8f115a12"><td class="memItemLeft" align="right" valign="top"><a id="a61b01a21cbcb7abdf4d05cca8f115a12"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>WebsocketInputStreambuf</b></td></tr>
<tr class="separator:a61b01a21cbcb7abdf4d05cca8f115a12"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents a single open connection for the plain <a class="el" href="classhttpsserver_1_1HTTPServer.html" title="Main implementation for the plain HTTP server. Use HTTPSServer for TLS support. ">HTTPServer</a>, without TLS. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a5e103c4b601199d575de6b6f29d7fb95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e103c4b601199d575de6b6f29d7fb95">&#9670;&nbsp;</a></span>getClientIP()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">IPAddress httpsserver::HTTPConnection::getClientIP </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the client's IPv4 </p>

<p>Implements <a class="el" href="classhttpsserver_1_1ConnectionContext.html">httpsserver::ConnectionContext</a>.</p>

</div>
</div>
<a id="a477f2a00400be60f3b0ca08ab53beda5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a477f2a00400be60f3b0ca08ab53beda5">&#9670;&nbsp;</a></span>initialize()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int httpsserver::HTTPConnection::initialize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>serverSocketID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classhttpsserver_1_1HTTPHeaders.html">HTTPHeaders</a> *&#160;</td>
          <td class="paramname"><em>defaultHeaders</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Initializes the connection from a server socket.</p>
<p>The call WILL BLOCK if accept(serverSocketID) blocks. So use select() to check for that in advance. </p>

</div>
</div>
<a id="af00c9a10be467a64ece8f820e939190d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af00c9a10be467a64ece8f820e939190d">&#9670;&nbsp;</a></span>isClosed()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool httpsserver::HTTPConnection::isClosed </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns true, if the connection has been closed. </p>

</div>
</div>
<a id="a6d8889292d644962a859e6e9b0bff305"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6d8889292d644962a859e6e9b0bff305">&#9670;&nbsp;</a></span>isError()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool httpsserver::HTTPConnection::isError </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns true, if the connection has been closed due to error </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/frank/Projekte/esp32/https_server/esp32_https_server/src/<a class="el" href="HTTPConnection_8hpp_source.html">HTTPConnection.hpp</a></li>
<li>/home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPConnection.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacehttpsserver.html">httpsserver</a></li><li class="navelem"><a class="el" href="classhttpsserver_1_1HTTPConnection.html">HTTPConnection</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
